package com.sc.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sc.mapper.ApplicationMapper;
import com.sc.pojo.Application;
import com.sc.service.ApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author 陈远坤
 */
@Service
@Transactional
public class ApplicationServiceImpl implements ApplicationService {
    @Autowired
    ApplicationMapper mapper;

    @Override
    public void addapp(Application app) {
        mapper.insertSelective(app);
    }

    @Override
    public PageInfo<Application> selectappById(Integer id, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Application> list= mapper.selectAllById(id);
        return new PageInfo<>(list);
    }

    @Override
    public void deleteBySendId(Integer sendid,Integer acceptid) {
        mapper.deleteBySendId(sendid,acceptid);
    }
}
